package com.jingbo.service.register;

import com.jingbo.DAO.User.Adduserimpl;
import com.jingbo.entity.User;

/**
 * @author jiangjingbo
 * @version V1.0
 * @Project java2203
 * @Package com.jingbo.service.register
 * @Description:
 * @Date 2022/5/27 12:57
 */
public class registeruserimpl implements registerUSer {
    private Adduserimpl adduserimpl;

    public registeruserimpl(Adduserimpl adduserimpl) {
        this.adduserimpl = adduserimpl;
    }

    /**
     * 添加用户
     *
     * @param user
     */
    @Override
    public Boolean AddUser(User user) {

        return adduserimpl.AddUserOne(user) != 0;
    }
    /**
     * 用户是否存在
     * @param username
     * @param pwd
     * @return
     */
    @Override
    public boolean selectUser(String username, String pwd) {
        User selectuser = adduserimpl.selectuser(username, pwd);
        return selectuser != null;
//        String s = MD5Utils.md5(pwd);
//        if(s.equals(pwd)){
//
//        }else {
//            return false;
//        }

    }
}
